package Methods;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Datee {
    //    日期的封装方法
    public static void date() {
        Date date = new Date();
        SimpleDateFormat f = new SimpleDateFormat(
                "yyyy-mm-dd hh:mm:ss");
        String time = f.format(date);
        String today = "2020-05-02";
        SimpleDateFormat format = new SimpleDateFormat(
                "yyyy-mm-dd");
        Date t = null;
        try {
            t = format.parse(today);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
